<?php
// 处理上传文件数组
function dealFiles($files) {
    $fileArray  = array();
    if(is_array($files['name'])){
        $count      =   count($files['name']);
        $keys       =   array_keys($files);
        for ($i=0; $i<$count; $i++) {
            foreach ($keys as $_key){
                $fileArray[$i][$_key] = $files[$_key][$i];
            }
        }
    }else{
        $fileArray = $files;
    }
   return $fileArray;
}